package edu.ccut.saturn.studio;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;

import org.eclipse.core.internal.runtime.InternalPlatform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import edu.ccut.saturn.studio.core.exception.XMLException;
import edu.ccut.saturn.studio.core.util.xml.SaturnW3CUtil;

/**
 * The activator class controls the plug-in life cycle
 */
public class Activator extends AbstractUIPlugin {

	public static final String PLUGIN_ID = "edu.ccut.saturn.studio";

	private static Activator plugin;

	private Map<String, Document> map;

	/**
	 * The constructor
	 */
	public Activator() {
		if (plugin == null) {
			plugin = this;
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		super.start(context);
		getBaseComponentsInputstreams();
		plugin = this;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		plugin = null;
		super.stop(context);
	}

	/**
	 * Returns the shared instance
	 * 
	 * @return the shared instance
	 */
	public static Activator getDefault() {
		return plugin;
	}

	public void getBaseComponentsInputstreams() {

		map = new HashMap<String, Document>();

		// baseComponents = new ArrayList<InputStream>();

		URL installedIn = InternalPlatform.getDefault().getInstallURL();

		String eclipse = installedIn.getPath() + "plugins";

		File pluginsfile = new File(eclipse);

		String[] pluginsJarfiles = this.getFilePathsFromClasspath(pluginsfile
				.getAbsolutePath().toString(), "jar");
		for (int i = 0; i < pluginsJarfiles.length; i++) {
			if (pluginsJarfiles[i].contains("edu.ccut.saturn.basecomponent")) {
				JarFile jarFile;
				File jar = new File(pluginsJarfiles[i]);
				try {
					jarFile = new JarFile(jar);
					Enumeration<?> jarEntries = jarFile.entries();
					while (jarEntries.hasMoreElements()) {
						ZipEntry ze = (ZipEntry) jarEntries.nextElement();
						if (ze.getName().endsWith("component")
								&& (ze.getName().contains("databaseComponent") || ze
										.getName().contains(
												"dataOperationComponent"))) {

							InputStream zestresam = null;
							try {
								zestresam = jarFile.getInputStream(ze);

								Document document = null;
								try {
									document = SaturnW3CUtil
											.getDocument(zestresam);
								} catch (XMLException e) {
									e.printStackTrace();
								}
								// String keyentry = ImplInSaturnNode
								// .getSaturnNodeKeyInDocument(document,
								// "component", "key");
								String keyentry = getSaturnNodeKeyInDocument(
										document, "component", "key");

								map.put(keyentry, document);
							} catch (IOException e) {
								e.printStackTrace();
							}

						}
					}
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

	public Map<String, Document> getMap() {
		return map;
	}

	public void setMap(Map<String, Document> map) {
		this.map = map;
	}

	public static String[] getFilePathsFromClasspath(String directory,
			String suffix) {
		File rootFile = null;

		URI classpath = getClasspath();

		// 如果directory无效,以classpath为根路径
		if (directory == null || directory.trim().equals("")) {
			rootFile = new File(classpath.getPath());
		} else {
			rootFile = new File(classpath.getPath()
					+ System.getProperty("file.separator") +

					directory);

			if (!rootFile.exists()) {
				throw new IllegalArgumentException(
						"In classpath: didn't have a directory path is: "
								+ directory);
			}
		}

		LinkedList<File> files = new LinkedList<File>();
		files.addLast(rootFile);

		List<String> availedFilePath = new LinkedList<String>();
		while (!files.isEmpty()) {
			File file = files.removeFirst();

			if (file.isDirectory()) {
				File[] subFiles = file.listFiles();
				for (int i = 0; i < subFiles.length; ++i) {
					files.add(subFiles[i]);
				}

				continue;
			}

			if (file.getName().endsWith(suffix)) {
				availedFilePath.add(file.getAbsolutePath().replace(
						System.getProperty

						("file.separator"), "/").replace(
						classpath.getPath().substring(1), ""));
			}
		}

		return availedFilePath.toArray(new String[availedFilePath.size()]);
	}

	public static URI getClasspath() {
		URI classpath = null;

		try {
			classpath = Thread.currentThread().getContextClassLoader()
					.getResource("").toURI();
		} catch (URISyntaxException e) {
			e.printStackTrace();
		}

		return classpath;
	}

	public static String getSaturnNodeKeyInDocument(Document document,
			String nodeName, String key) {
		Element rootElement = document.getDocumentElement();
		NodeList componentnodes = rootElement.getElementsByTagName(nodeName);

		for (int i = 0; i < componentnodes.getLength(); i++) {
			Node componentNode = componentnodes.item(i);
			if (componentNode.getNodeType() == Node.ELEMENT_NODE) {
				String key_value = SaturnW3CUtil.getNodeAttributeValue(
						componentNode, key);
				if (key_value != null && !key_value.equals("")) {
					return key_value;
				}
			}
		}
		return null;

	}

	protected void initializeImageRegistry(ImageRegistry reg) {
		super.initializeImageRegistry(reg);

		reg.put(Images.DATABASE_CONNECTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/DBConnectView.gif"));
		reg.put(Images.DATABASE_TABLE_FOLDER, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/tableFolder.gif"));
		reg.put(Images.DATABASE_VIEW_FOLDER, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/viewFolder.gif"));
		reg.put(Images.DATABASE_VIEW, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/view.gif"));
		reg.put(Images.DATABASE_TABLE, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/table.gif"));
		reg.put(Images.DATABASE_NODE6, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/reverseFlag.gif"));
		reg.put(Images.DATABASE_COLUMN_PRIMER_KEY, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/keycolumn.gif"));
		reg.put(Images.DATABASE_COLUMN, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/field_common.gif"));
		reg.put(Images.DATABASE_NODE9, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/MngDBCon.gif"));
		reg.put(Images.DATABASE_SCHEMA, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/schema.gif"));
		reg.put(Images.DATABASE_NODE11, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/persistence_small_new0.GIF"));
		reg.put(Images.PROJECT_NAME, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/saturn/project.gif"));

		// reg.put(Images.PACKAGE, imageDescriptorFromPlugin(PLUGIN_ID,
		// "icons/package_obj.gif"));
		//
		// reg.put(Images.JAVASCRIPT, imageDescriptorFromPlugin(PLUGIN_ID,
		// "icons/javascript.gif"));

		reg.put(Images.DATAFIELD, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/saturn/sca.gif"));
		reg.put(Images.ACTION_FOLDER_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/folder/action_tianfolder.gif"));
		reg.put(Images.LOGIC_FOLDER_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/folder/logic_saturnfolder.gif"));
		reg.put(Images.COMPONENT_FOLDER_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/folder/component_saturnfolder.gif"));
		reg.put(Images.DATA_FOLDER_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/folder/data_saturnfolder.gif"));
		reg.put(Images.DATADICT_FOLDER_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/folder/datadict.gif"));
		reg.put(Images.PAGE_FOLDER_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/folder/page_saturnfolder.gif"));
		reg.put(Images.SCA_FOLDER_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/folder/sca_saturnfolder.gif"));
		reg.put(Images.VALIDATE_FOLDER_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/folder/validate_saturnfolder.gif"));
		reg.put(Images.WORKFLOW_FOLDER_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/folder/workflow_saturnfolder.gif"));

		reg.put(Images.MODEl_FOLDER_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				"icons/folder/model.gif"));

		reg.put(Images.SATURNDATA_SEQUENCE_TABLE, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/table.gif"));
		reg.put(Images.NEWSATURN_ACTION_ACTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/saturn/action.gif"));
		reg.put(Images.NEWSATURN_COMPONENT_ACTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/saturn/component.gif"));
		reg.put(Images.NEWSATURN_DATAITEM_ACTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/saturn/dataItem.gif"));
		reg.put(Images.NEWSATURN_LOGIC_ACTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/saturn/logic.gif"));
		reg.put(Images.NEWSATURN_PAGE_ACTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/saturn/page.gif"));
		reg.put(Images.NEWSATURN_PROJECT_ACTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/persistence_small.GIF"));
		reg.put(Images.NEWSATURN_VALIDATE_ACTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/saturn/validate.gif"));
		reg.put(Images.NEWSATURN_WORKFLOW_ACTION, imageDescriptorFromPlugin(
				PLUGIN_ID, "icons/saturn/workflow.gif"));

		reg.put(Images.AMPLIFY_MINUS, imageDescriptorFromPlugin(PLUGIN_ID,
				AMPLIFY_MINUS));
		reg.put(Images.AMPLIFY_PLUS, imageDescriptorFromPlugin(PLUGIN_ID,
				AMPLIFY_PLUS));
		reg.put(Images.SATURN_ICONS_MAXNAME, imageDescriptorFromPlugin(
				PLUGIN_ID, SATURN_ICONS_MAX));
		reg.put(Images.SATURN_ICONS_SMALLNAME, imageDescriptorFromPlugin(
				PLUGIN_ID, SATURN_ICONS_SMALL));

		reg.put(Images.ACTION_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				SATURN_ACTION_MAX));
		reg.put(Images.COMPONENT_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				COMPONENT_NAME));
		reg.put(Images.DATAMAP_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				DATAMAP_MAX_NAME));
		reg.put(Images.DATA_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				DATA_MAX_NAME));
		reg.put(Images.DECISION_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				DECISION_MANX_NAME));
		reg.put(Images.FOR_START_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				FOR_START_MAX_NAME));
		reg.put(Images.FOR_END_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				FOR_END_NAME));
		reg.put(Images.END_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				END_MANX_NAME));
		reg.put(Images.INFORMATION_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				INFORMATION_NAME));
		reg.put(Images.LOGIC_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				LOGIC_MANX_NAME));
		reg.put(Images.START_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				START_NAME));
		reg.put(Images.START_ICON_SMALL, imageDescriptorFromPlugin(PLUGIN_ID,
				START_MINI_NAME));
		reg.put(Images.START_ICON_BIG, imageDescriptorFromPlugin(PLUGIN_ID,
				START_NAME));
		reg.put(Images.SWICH_MAX, imageDescriptorFromPlugin(PLUGIN_ID,
				SWICH_MAX));
		reg.put(Images.TRANSATIONBEGIN_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, TRANSATIONBEGIN_MAX_NAME));
		reg.put(Images.TRANSATIONCOMMIT_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, TRANSATIONCOMMIT_MAX_NAME));
		reg.put(Images.TRANSATIONROLLBACK_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, TRANSATIONROLLBACK_MAX_NAME));
		reg.put(Images.TRANSFORM_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				SATURN_TTANSFORM_MAX));
		reg.put(Images.VIEW_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				VIEW_MAX_NAME));
		reg.put(Images.WEB_CONTEXT_IMAGE, imageDescriptorFromPlugin(PLUGIN_ID,
				SATURN_WEBCONTEXT_BIG));
		reg.put(Images.WORK_FLOW_BIG, imageDescriptorFromPlugin(PLUGIN_ID,
				WF_BIG));
		reg.put(Images.WORK_FLOW_SMALL, imageDescriptorFromPlugin(PLUGIN_ID,
				WF_SMALL));

		// ShapeEditPart
		reg.put(Images.LOGIC_ICON_SMALL, imageDescriptorFromPlugin(PLUGIN_ID,
				LOGIC_MINI_NAME));
		reg.put(Images.COMPONENT_ICON_SMALL, imageDescriptorFromPlugin(
				PLUGIN_ID, COMPONENT_MINI_NAME));
		reg.put(Images.ACTION_ICON_SMALL, imageDescriptorFromPlugin(PLUGIN_ID,
				SATURN_ACTION_MIN));
		reg.put(Images.BLUE_IN, imageDescriptorFromPlugin(PLUGIN_ID, BLUE_IN));
		reg
				.put(Images.BLUE_OUT, imageDescriptorFromPlugin(PLUGIN_ID,
						BLUE_OUT));
		reg.put(Images.BLUE_INOUT, imageDescriptorFromPlugin(PLUGIN_ID,
				BLUE_INOUT));
		reg.put(Images.PLUS, imageDescriptorFromPlugin(PLUGIN_ID, SATURN_ADD));
		reg.put(Images.REDUCE, imageDescriptorFromPlugin(PLUGIN_ID,
				SATURN_REDUCE));

		// --------------工作流---------------------------

		reg
				.put(Images.ROOTICON, imageDescriptorFromPlugin(PLUGIN_ID,
						ROOTICON));

		reg.put(Images.SECONDICON, imageDescriptorFromPlugin(PLUGIN_ID,
				SECONDICON));
		reg.put(Images.SECONDICON_DEPARTMENT, imageDescriptorFromPlugin(
				PLUGIN_ID, SECONDICON_DEPARTMENT));

		reg
				.put(Images.ROLEICON, imageDescriptorFromPlugin(PLUGIN_ID,
						ROLEICON));

		reg.put(Images.PERSONICON, imageDescriptorFromPlugin(PLUGIN_ID,
				PERSONICON));

		reg.put(Images.DEPARTMENTICON, imageDescriptorFromPlugin(PLUGIN_ID,
				DEPARTMENTICON));

		reg.put(Images.POSITIONICON, imageDescriptorFromPlugin(PLUGIN_ID,
				POSITIONICON));

		reg.put(Images.BIG_END_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				BIG_END_ICON));

		reg.put(Images.SMALL_END_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				SMALL_END_ICON));

		reg.put(Images.BIG_START_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				BIG_START_ICON));

		reg.put(Images.SMALL_START_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				SMALL_START_ICON));

		reg.put(Images.BIG_HUMAN_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				BIG_HUMAN_ICON));

		reg.put(Images.SMALL_HUMAN_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				SMALL_HUMAN_ICON));

		reg.put(Images.BIG_INFORMATION_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, BIG_INFORMATION_ICON));

		reg.put(Images.SMALL_INFORMATION_ICON, imageDescriptorFromPlugin(
				PLUGIN_ID, SMALL_INFORMATION_ICON));

		reg.put(Images.BIG_ROUTER_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				BIG_ROUTER_ICON));

		reg.put(Images.SMALL_ROUTER_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				SMALL_ROUTER_ICON));

		reg.put(Images.BIG_AUTO_ACTIVITY, imageDescriptorFromPlugin(PLUGIN_ID,
				BIG_AUTO_ACTIVITY));

		reg.put(Images.SMALL_AUTO_ACTIVITY, imageDescriptorFromPlugin(
				PLUGIN_ID, SMALL_AUTO_ACTIVITY));

		reg.put(Images.BIG_SUB_ACTIVITY, imageDescriptorFromPlugin(PLUGIN_ID,
				BIG_SUB_ACTIVITY));

		reg.put(Images.SMALL_SUB_ACTIVITY, imageDescriptorFromPlugin(PLUGIN_ID,
				SMALL_SUB_ACTIVITY));

		reg.put(Images.SATURN_PAGE_MIN, imageDescriptorFromPlugin(PLUGIN_ID,
				SATURN_PAGE_MIN));

		reg.put(Images.DATA_MIN_ICON, imageDescriptorFromPlugin(PLUGIN_ID,
				DATA_MIN_NAME));

	}

	public static Image getImage(String symbolicName) {
		return getDefault().getImageRegistry().get(symbolicName);
	}

	public static ImageDescriptor getImageDescriptor(String symbolicName) {
		return getDefault().getImageRegistry().getDescriptor(symbolicName);
	}

	// 需要重构 refactorUtill 能不能写成本地类

	// TODO：以下在整合CNF时保留，需要重构
	public static IWorkbenchWindow getActiveWorkbenchWindow() {
		return getDefault().getWorkbench().getActiveWorkbenchWindow();
	}

	// TODO：以下在整合CNF时保留，
	public static Shell getShell() {
		if (getActiveWorkbenchWindow() != null)
			return getActiveWorkbenchWindow().getShell();
		else
			return null;
	}

	// ----------------公用的----------------------------------------

	public final static String SATURN_ICONS_MAX = "/icons/" + "HDbig.GIF";

	public final static String SATURN_ICONS_SMALL = "/icons/" + "HDsmall.GIF";

	public final static String AMPLIFY_MINUS = "/icons/" + "amplify_minus.jpg";

	public final static String AMPLIFY_PLUS = "/icons/" + "amplify_plus.jpg";

	// -----------------logic-------------------

	public final static String PATH = "/icons/logic/";

	public final static String DEBUG_PATH = "/icons/logic/debug/";

	public final static String START_MINI_NAME = PATH + "start.gif";

	public final static String START_NAME = PATH + "start_max.gif";

	public final static String SATURN_PAGE_MIN = PATH + "Search_Jsp.gif";

	public final static String COMPONENT_NAME = PATH + "component_max.gif";

	public final static String COMPONENT_MINI_NAME = PATH + "component.gif";

	public final static String INFORMATION_MINI_NAME = PATH + "infomation.gif";

	public final static String INFORMATION_NAME = PATH + "infomation_max.gif";

	public final static String END_MANX_NAME = PATH + "end_max.gif";

	public final static String END_MINI_NAME = PATH + "end.gif";

	public final static String LOGIC_MINI_NAME = PATH + "logic.gif";

	public final static String LOGIC_MANX_NAME = PATH + "logic_max.gif";

	public final static String DECISION_MANX_NAME = PATH + "decision_max.gif";

	public final static String DECISION_MINI_NAME = PATH + "decision.gif";

	public final static String FOR_START_MINI_NAME = PATH
			+ "iterationBegin.gif";

	public final static String FOR_START_MAX_NAME = PATH
			+ "iterationBegin_max.gif";

	public final static String FOR_END_NAME = PATH + "iterationEnd_max.gif";

	public final static String FOR_END_MINI_NAME = PATH + "iterationEnd.gif";

	public final static String VIEW_MAX_NAME = PATH + "view.gif";

	public final static String VIEW_MIN_NAME = PATH + "view_min.gif";

	public final static String TRANSATIONBEGIN_NAME = PATH
			+ "transaction_begin.gif";

	public final static String TRANSATIONBEGIN_MAX_NAME = PATH
			+ "transaction_begin_max.gif";

	public final static String TRANSATIONCOMMIT_NAME = PATH
			+ "transaction_commit.gif";

	public final static String TRANSATIONCOMMIT_MAX_NAME = PATH
			+ "transaction_commit_max.gif";

	public final static String TRANSATIONROLLBACK_MAX_NAME = PATH
			+ "transaction_rollback_max.gif";

	public final static String TRANSATIONROLLBACK_NAME = PATH
			+ "transaction_rollback.gif";
	public final static String DATA_MAX_NAME = PATH + "data_max.gif";

	public final static String DATA_MIN_NAME = PATH + "data_min.gif";

	public final static String DATAMAP_MAX_NAME = PATH + "datamap_max.gif";

	public final static String DATAMAP_MIN_NAME = PATH + "datamap_min.gif";

	public final static String SOLID_CONNECTION_MAX = PATH
			+ "connection_s24.gif";
	public final static String SOLID_CONNECTION_MIN = PATH
			+ "connection_s16.gif";
	public final static String DASHED_CONNECTION_MIN = PATH
			+ "connection_d16.gif";

	public final static String DASHED_CONNECTION_MAX = PATH
			+ "connection_d24.gif";
	public final static String ECLIPSE_ICON = PATH + "eclipse.gif";
	public final static String SATURN_ACTION_MAX = PATH
			+ "appoint_activity_32.gif";
	public final static String SATURN_ACTION_MIN = PATH + "appoint_activity.gif";

	public final static String SATURN_OUTLINE = PATH + "outline.gif";

	public final static String SATURN_OVERVIEW = PATH + "overview.gif";

	public final static String SATURN_TTANSFORM_MAX = PATH + "transform_max.gif";

	public final static String SATURN_TTANSFORM_MIN = PATH + "transform_min.gif";

	public final static String SATURN_EXCEPTION_CONNECTION = PATH
			+ "exception.gif";
	public final static String SATURN_WEBCONTEXT_BIG = PATH + "web_context.gif";

	public final static String SATURN_WEBCONTEXT_SMALL = PATH
			+ "web_context_min.gif";

	public final static String SATURN_ADD = PATH + "plus.gif";
	public final static String SATURN_REDUCE = PATH + "reduce.gif";

	public final static String BLUE_IN = PATH + "blue_in.png";
	public final static String GREEN_IN = PATH + "green_in.png";
	public final static String BLUE_OUT = PATH + "blue_out.png";
	public final static String GREEN_OUT = PATH + "green_out.png";
	public final static String BLUE_INOUT = PATH + "blue_inout.png";
	public final static String GREEN_INOUT = PATH + "green_inout.png";

	public final static String WF_BIG = PATH + "wf_big.gif";
	public final static String WF_SMALL = PATH + "wf_small.gif";

	public final static String SWICH = PATH + "router.gif";

	public final static String SWICH_MAX = PATH + "router_max.gif";

	// debug
	public final static String DEBUG_ACTION = DEBUG_PATH + "action.gif";

	public final static String DEBUG_DATABASE = DEBUG_PATH + "database.gif";

	public final static String DEBUG_ITERATIONBEGIN = DEBUG_PATH
			+ "iterationBegin.gif";

	public final static String DEBUG_ITERATIONEND = DEBUG_PATH
			+ "iterationEnd.gif";

	public final static String DEBUG_DECESION = DEBUG_PATH
			+ "processSwitch.gif";

	public final static String DEBUG_END = DEBUG_PATH + "end.gif";

	public final static String DEBUG_LOGIC = DEBUG_PATH + "subProcess.gif";

	public final static String DEBUG_TRANSCATION_BEGIN = DEBUG_PATH
			+ "transaction_begin.gif";
	public final static String DEBUG_TRANSCATION_COMMIT = DEBUG_PATH
			+ "transaction_commit.gif";
	public final static String DEBUG_TRANSCATION_ROLLBACK = DEBUG_PATH
			+ "transaction_rollback.gif";
	public final static String DEBUG_VIEW = DEBUG_PATH + "view.gif";
	public final static String DEBUG_EXEC = DEBUG_PATH + "debug_exc.gif";

	// WFG

	public final static String WFG_PATH = "/icons/wfg/";

	public final static String ROOTICON = WFG_PATH + "rootIcon.gif";

	public final static String SECONDICON = WFG_PATH + "secondIcon.gif";
	public final static String SECONDICON_DEPARTMENT = WFG_PATH
			+ "secondIcon_department.gif";

	public final static String ROLEICON = WFG_PATH + "roleIcon.gif";

	public final static String PERSONICON = WFG_PATH + "personIcon.gif";

	public final static String DEPARTMENTICON = WFG_PATH + "departmentIcon.gif";

	public final static String POSITIONICON = WFG_PATH + "positionIcon.gif";

	public final static String BIG_END_ICON = WFG_PATH + "end_activity48.gif";

	public final static String SMALL_END_ICON = WFG_PATH + "end_activity16.gif";

	public final static String BIG_START_ICON = WFG_PATH
			+ "start_activity48.gif";

	public final static String SMALL_START_ICON = WFG_PATH
			+ "start_activity16.gif";

	public final static String BIG_HUMAN_ICON = WFG_PATH
			+ "manual_activity48.gif";

	public final static String SMALL_HUMAN_ICON = WFG_PATH
			+ "manual_activity16.gif";

	public final static String BIG_INFORMATION_ICON = WFG_PATH + "info48.gif";

	public final static String SMALL_INFORMATION_ICON = WFG_PATH + "info16.gif";

	public final static String BIG_ROUTER_ICON = WFG_PATH
			+ "router_activity48.gif";

	public final static String SMALL_ROUTER_ICON = WFG_PATH
			+ "router_activity16.gif";

	// public final static String WFG_AMPLIFY_PLUS = WFG_PATH +
	// "amplify_plus.jpg";
	//		
	// public final static String WFG_AMPLIFY_MINUS = WFG_PATH +
	// "amplify_minus.jpg";

	public final static String BIG_AUTO_ACTIVITY = WFG_PATH
			+ "auto_activity48.gif";

	public final static String SMALL_AUTO_ACTIVITY = WFG_PATH
			+ "auto_activity16.gif";

	public final static String BIG_SUB_ACTIVITY = WFG_PATH
			+ "sub_activity48.gif";

	public final static String SMALL_SUB_ACTIVITY = WFG_PATH
			+ "sub_activity16.gif";

	public final static String SMALL_CONNECTION_ACTIVITY = WFG_PATH
			+ "connection_s16.gif";

	public final static String BIG_CONNECTION_ACTIVITY = WFG_PATH
			+ "connection_s24.gif";

}
